package com.neborosoft.FlyingDog.logic.database.providers;

import com.neborosoft.FlyingDog.logic.database.AudioDataManager;
import com.neborosoft.FlyingDog.logic.database.content.identified.PlayList;
import com.neborosoft.lib.collections.tree.NTree;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: CM
 * Date: 01.12.12
 * Time: 21:54
 * To change this template use File | Settings | File Templates.
 */
public class PlayListsTree extends NTree {
    private static final int LEVELS_COUNT = 2;

    public PlayListsTree() {
        super(LEVELS_COUNT);
    }

    @Override
    protected List<PlayList> getRootItems() {
        List<PlayList> playLists = AudioDataManager.getInstance().getPlayLists();
        return playLists;
    }

    @Override
    protected List getChildrenOfParent(Object parent, int level, int stepsCount) {
        PlayList playList = (PlayList)parent;
        return AudioDataManager.getInstance().getTracksOfPlayList(playList);
    }
}
